#pragma once
#include "Handler.h"
#include "IEventHandler.h"
#include "ReactorImplementation.h"


template <typename T>
class IReactor
{
public:
	IReactor(ReactorImplementation<T>* reactor)
		:reactor_imp(reactor)
	{}
	virtual void register_handler(IEventHandler<T> *eh,Event_Type et) = 0;
	virtual void register_handler(Handler<T> h, IEventHandler<T> *eh, Event_Type et) = 0;

	virtual void remove_handler(IEventHandler<T> *eh,Event_Type et) = 0;
	virtual void remove_handler(Handler<T> h, Event_Type et) = 0;

	virtual bool handle_events(timeval *timeout = 0) = 0;

protected:
	ReactorImplementation<T> *reactor_imp;
};

